<%--

  User: PING
  Date: 2022/9/7
  Time: 9:50
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.nio.charset.StandardCharsets" %>
<%@ page import="java.net.URLEncoder" %>
<%@ page import="java.net.URLDecoder" %>
<html lang="zh-CN">
<meta charset="UTF-8">
<head>
    <title>jsp example</title>
    <link rel="stylesheet" href="../css/main.css"/>
    <style>
        .login {

            padding-left:10px;
            width:450px ;
            height:600px;
            border: solid 2px #eee;
            margin:10px auto;
            border-radius: 10px;

        }
        .title {
            text-align: center;
            font-size:28px;
        }
        .form {
            float:left;
            padding-left: 50px;
        }
        .warning {
            margin-top:15px;
            padding-left:10px ;
            color: darkorange;

        }


        .form p {
            font-size:14px;
        }
        .form input {
            margin-top:15px;
            border: none;
            border-bottom: solid 1px #eee;
            outline-style: none;
            height:35px;
        }
        .form input[type="text"]:focus,
        .form input[type="password"]:focus {
            border-bottom: solid 1px skyblue;
        }

        .form input[type="submit"] {
            width:60%;
            height: 40px;
            background-color: skyblue;
            color:#fff;
            border:none;
        }
        .form input[type="submit"]:hover {
            background-color: #490104;
            color: #fff;
        }

    </style>
</head>
<body>
<%
//    request.setCharacterEncoding("UTF-8");
    String info = request.getParameter("info") ;
    String test = null ;
    System.out.println(test.toString()) ;
    System.out.println("INFO:" + info) ;
    if (info != null) {
        info = URLDecoder.decode(info, "UTF-8");
        System.out.println("after decoded INFO: " + info) ;
    } else {
        info = "" ;
    }
//    info = java.net.URLDecoder.decode(info, "UTF-8") ;

%>
    <div class="container">
        <div class="logo">
        </div>
        <hr>
        <div class="main">
            <div class="show">
                <h2>演示部分</h2>

                <div class="login">
                    <div class="title">
                        <p>登录</p>
                    </div>
                    <div class="form">
                        <form action="02_process.jsp" method="get">
                            <span class="warning"><%=info == null ? "" : info%></span>
                            <p>你的名字：</p>
                            <input type="text" name="username" placeholder="input your name">
                            <p>你的密码：</p>
                            <input type="password" name="password" placeholder="your password">
                            <input type="submit" name="提 &nbsp;交">
                        </form>
                    </div>
                </div>
            </div>
        </div>

    </div>
    <footer>
        <div class="copyright">
            JAVA WEB &copy; FJNU
        </div>
    </footer>
</body>
</html>
